gtkbutton: Don't claim gesture till emission
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 5 Aug 2020 20:56:05 +0000 (22:56 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 5 Aug 2020 22:01:18 +0000 (00:01 +0200)
That means waiting till button release.

gtk/gtkbutton.c

index 843c1f49a0ecf5e77733e0a70a593b6d2a3d59b9..eac1499b0d812d4635db7b18afd4ded634f44b04 100644 (file)
@@ -327,8 +327,6 @@ click_pressed_cb (GtkGestureClick *gesture,
 
   if (!priv->activate_timeout)
     priv->button_down = TRUE;
-
-  gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
 }
 
 static gboolean
@@ -364,6 +362,7 @@ click_released_cb (GtkGestureClick *gesture,
   GtkButtonPrivate *priv = gtk_button_get_instance_private (button);
   GdkEventSequence *sequence;
 
+  gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
   gtk_button_do_release (button,
                          gtk_widget_is_sensitive (GTK_WIDGET (button)) &&
                          (priv->in_button ||